<?php
/**
 * main.php file.
 *
 * @author Yufan <nimanyi@gmail.com>
 * @link http://www.dedecms.cn/
 * @copyright Copyright &copy; 2010-2012 Yufan Software LLC
 * @license http://www.dedecms.cn/license/
 * @version $Id: main.php 2011-12-7 7:28:36 Yufan $
 * @since 1.0
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title><?php echo CHtml::encode($this->pageTitle) ?></title>
        <?php
        echo CHtml::metaTag(sprintf('%s,%s',  CHtml::encode($this->keyWord), param('shortdesc')), 'keywords');
        echo CHtml::metaTag(sprintf('%s', CHtml::encode($this->desCription)), 'description');
        echo CHtml::metaTag('all', 'robots');
        echo CHtml::metaTag('document', 'Resource-Type');
        echo CHtml::metaTag('global', 'Distribution');
        echo CHtml::metaTag(CHtml::encode(param('author')),'Author');
        echo CHtml::metaTag(CHtml::encode(param('domain')), 'Generator');
        echo CHtml::metaTag('Copyright (c) ' . date("Y") .  CHtml::encode(param('domain')) .' All Rights Reserved.', 'CopyRight');
        echo CHtml::metaTag('general', 'rating');
        echo CHtml::linkTag('shortcut icon', 'image/x-icon', '/favicon.ico');
        echo CHtml::script('BU = \'' . abu() . '\'; TBU = \'' . tbu() . '\'; RESBU = \'' . resBu() . '\'; SBU = \'' . sbu() . '\'; CSRF_TOKEN = \'' . request()->csrfTokenName . '\'');
        ?>
        <script type="text/javascript" charset="utf-8">
            // Navigation Menu
            $(function() {
                $("#dropmenu ul").css({display: "none"}); // Opera Fix
                $("#dropmenu li").hover(function(){
                    $(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown("normal");
                },function(){
                    $(this).find('ul:first').css({visibility: "hidden"});
                });
            });

            $(function() {
                $("#dropmenu a").addClass("png");
            });
            // Mouse Hover
<?php if('view' != $this->action->id):?>
    $(function() {
        $(".post").mouseover(function(){
            $(this).css({ border:"1px solid #DDD", background:"#FFF"});
            $("h2 a:first",this).css({ display:"block", color:"#FF0242"});
        }).mouseout(function(){
            $(this).css({ border:"1px solid #E6E6E6", background:"#F5F6F7"});
            $("h2 a:first",this).css({ color:"#24282B"});
        });

    });
<?php endif;?>
    // Delay Image
    $(function() {
        $(".post img").lazyload({
            placeholder : "<?php echo $baseUrl?>/images/grey.gif",
            effect : "fadeIn"
        });
    });

    //Slide to any anchor
    $(document).ready(function() {
        $("a.anchorLink").anchorAnimate()
    });

    jQuery.fn.anchorAnimate = function(settings) {

        settings = jQuery.extend({
            speed : 1100
        }, settings);

        return this.each(function(){
            var caller = this
            $(caller).click(function (event) {
                event.preventDefault()
                var locationHref = window.location.href
                var elementClick = $(caller).attr("href")

                var destination = $(elementClick).offset().top;
                $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
                    window.location.hash = elementClick
                });
                return false;
            })
        })
    }
        </script>
        <script type="text/javascript">
            $(function () {
                $('.post img').hover(
                function() {$(this).fadeTo("fast", 0.5);},
                function() {$(this).fadeTo("fast", 1);
                });
            });
        </script>

        <style type="text/css">
            .recentcomments li{line-height: 20px;color: #0196E3;}
            .recentcomments li img {
                float: left;
                padding: 1px;
                margin: 4px 4px 0 0;
            }
            .logo a:link, .logo a:visited, .logo a:hover{
                _background:none;
                _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<?php echo tbu();?>/styles/images/logo.png" ,sizingMethod="crop");
            }
        </style>
    </head>
    <body style="background-image:url(<?php echo  tbu();?>/styles/images/bg.jpg);">
        <!-- Header begin -->
        <div id="header">
            <!-- SNS begin -->
            <div class="sns">
                <div class="rss">
                    <a href="<?php echo $this->createUrl('/blog/rss')?>" title="订阅本站" target="_blank" class="rssfeed">订阅本站</a>
                    <!-- 用QQ邮箱阅读空间订阅我的博客 -->
                    <a href="http://mail.qq.com/cgi-bin/feed?u=http://graytime.com/blog/rss" target="_blank">
                        <img style="margin-top: 4px;" src="http://res.mail.qq.com/zh_CN/htmledition/images/rss/icon_sub01.gif" alt=""  border="0" />
                    </a><!-- 用QQ邮箱阅读空间订阅我的博客 -->
                </div>
            </div>
            <!-- SNS end -->
            <!-- Header-inner begin -->
            <div class="head">
                <!-- Description PageMenu begin -->
                <div class="description_pagelist">
                    <div class="description">Gray &amp;&amp; Simple &amp;&amp; Share</div>
                    <ul class="pagelist">
                        <?php //$this->widget('VTopNavigation'); ?>
                    </ul>
                </div>
                <!-- Description PageMenu end -->
                <!-- Logo Banner begin -->
                <div class="logo_banner">
                    <h1 class="logo"><a href="<?php echo $this->createUrl('/blog')?>" title="<?php echo Yii::app()->name?>"><?php echo Yii::app()->name?></a></h1>
                    <!-- Banner begin -->
                    <div class="banner">
                        <img src="<?php echo tbu().'/styles/images/count.gif'?>" alt="" />
                    </div>
                    <!-- Banner end -->
                </div>
                <!-- Logo Banner end -->
                <!-- Main Navigation begin -->
                <ul class="navigation" id="dropmenu">
                    <li class="cat-item current-cat"><a class="png" href="http://demo.wpyou.com/"><span class="png">首页</span></a></li>
                    <li class="cat-item cat-item-1"><a title="这里是每个分类的描述，后台分类中添加。" href="http://demo.wpyou.com/category/news" class="png"><span class="png">新闻公告</span></a>
                        <ul class="children" style="display: block; visibility: hidden;">
                            <li class="cat-item cat-item-16"><a title="这里是每个分类目录的描述，后台分类目录中添加。" href="http://demo.wpyou.com/category/news/showcase" class="png"><span class="png">成功案例</span></a>
                            </li>
                            <li class="cat-item cat-item-17"><a title="查看 行业动态 下的所有文章" href="http://demo.wpyou.com/category/news/industry" class="png"><span class="png">行业动态</span></a>
                            </li>
                        </ul>
                    </li>
                    <li class="cat-item cat-item-5"><a title="查看 行业主机 下的所有文章" href="http://demo.wpyou.com/category/blog-hosting-domainname" class="png"><span class="png">行业主机</span></a>
                    </li>
                    <li class="cat-item cat-item-6"><a title="查看 行业进阶 下的所有文章" href="http://demo.wpyou.com/category/c" class="png"><span class="png">行业进阶</span></a>
                        <ul class="children" style="display: none;">
                            <li class="cat-item cat-item-8"><a title="查看 网友投稿 下的所有文章" href="http://demo.wpyou.com/category/c/bsp-blog-hosting" class="png"><span class="png">网友投稿</span></a>
                            </li>
                            <li class="cat-item cat-item-13"><a title="查看 网络营销 下的所有文章" href="http://demo.wpyou.com/category/c/blog-market" class="png"><span class="png">网络营销</span></a>
                            </li>
                            <li class="cat-item cat-item-14"><a title="查看 精彩视频 下的所有文章" href="http://demo.wpyou.com/category/c/video" class="png"><span class="png">精彩视频</span></a>
                            </li>
                            <li class="cat-item cat-item-15"><a title="查看 行业设计 下的所有文章" href="http://demo.wpyou.com/category/c/brand-vi" class="png"><span class="png">行业设计</span></a>
                            </li>
                            <li class="cat-item cat-item-476"><a title="查看 产品推荐 下的所有文章" href="http://demo.wpyou.com/category/c/recommend" class="png"><span class="png">产品推荐</span></a>
                            </li>
                        </ul>
                    </li>
                    <li class="cat-item cat-item-12"><a title="   " href="http://demo.wpyou.com/category/products" class="png"><span class="png">图片展示</span></a>
                        <ul class="children" style="display: block; visibility: hidden;">
                            <li class="cat-item cat-item-10"><a title="查看 行业故事 下的所有文章" href="http://demo.wpyou.com/category/products/retail" class="png"><span class="png">行业故事</span></a>
                            </li>
                            <li class="cat-item cat-item-11"><a title="查看 行业空间 下的所有文章" href="http://demo.wpyou.com/category/products/blog-host" class="png"><span class="png">行业空间</span></a>
                            </li>
                            <li class="cat-item cat-item-480"><a title="查看 网站优化 下的所有文章" href="http://demo.wpyou.com/category/products/web-seo" class="png"><span class="png">网站优化</span></a>
                            </li>
                        </ul>
                    </li>
                    <li class="cat-item cat-item-18"><a title="查看 在线应用 下的所有文章" href="http://demo.wpyou.com/category/blog-online-application" class="png"><span class="png">在线应用</span></a>
                    </li>
                </ul>
            </div>
            <?php
//                $items = array();
//                $items[] = array('label'=>'<span>首页</span>', 'url'=>array('/blog/post/index'),'itemOptions'=>array('class'=>'cat-item'));
//                $menus = tree::getCates($this->cate_id);
//                foreach ($menus as $vi) {
//                    if($vi->id != $this->cate_id)
//                        $items[] = array('label'=>'<span>'.$vi->name.'</span>', 'url'=>array('/blog/post/category','id'=>$vi->id),'itemOptions'=>array('class'=>'cat-item'));
//                }
//                $this->widget('zii.widgets.CMenu', array(
//                        'items'=>$items,
//                        'id'=>'dropmenu',
//                        'encodeLabel'=>false,
//                        'activeCssClass'=>'current-cat',
//                        'htmlOptions'=>array('class'=>'navigation'),
//                ));
            ?>
            <!-- Main Navigation end -->
            <!-- Search Begin-->

            <div class="search" style="">
                <form method="get" id="searchform" class="searchform" action="<?php echo $this->createUrl('search')?>">
                    <input class="searchInput" type="text" value="<?php echo isset($_GET['s'])? $_GET['s'] : ''?>" name="s" id="s"/>
                    <input class="searchBtn" type="submit" id="searchsubmit" value="搜 索"/>
                </form>
            </div>      	<!-- Search end-->
        </div>
        <!-- Header-inner end -->
        <!-- Header end -->
        <div class="breadcrumb">
            <div class="crumb">
		                  当前位置: <a href="http://demo.wpyou.com">WPYOU主题演示</a> &gt; 首页
            </div>
            <!-- Search Begin-->    	<!-- Search end-->
                            </div>
                            <!-- Content begin -->
                            <div id="content">
                                <!-- Article begin -->
                                <div class="article">
                                    <!-- Breadcrumb begin -->
                                    <div class="breadcrumb">
                                        <?php $this->widget('zii.widgets.CBreadcrumbs', array(
                                                'links'=>$this->breadcrumbs,
                                                'homeLink'=>'当前位置',
                                                'htmlOptions' => array('class'=>'crumb'),
                                        )); ?><!-- breadcrumbs -->
                                    </div>
                                    <!-- Breadcrumb end -->
                                    <?php echo $content; ?>
                                </div>
                                <!-- Article end -->
                                <?php //echo $this->renderPartial('/layouts/main_sidebar'); ?>
                            </div>
                            <!-- Content end -->
                            <div class="clear"></div>
                            <!-- Footer begin -->
                            <div id="footer">
                                <p>Copyright &copy; 2010-2012 <?php echo Yii::powered(); ?> | Theme by <a href="http://www.wpyou.com/"  target="_blank">WPYOU</a> | Modify by <a href="http://www.graytime.com/"  target="_blank">灰色创想</a> | 豫ICP备10025312号-1
                                    |
                                    <?php if('postView' == $this->id.ucfirst($this->action->id)):?>

                                    <?php endif;?>

                                </p>
                                <span><a href="#header" class="anchorLink">返回顶部</a></span>
                            </div>
                            <!-- Footer end -->
                            <?php
                            cs()->registerCssFile(tbu('styles/style.css'), 'screen');
                            cs()->registerCssFile(tbu('styles/pager.css'), 'screen');
                            cs()->registerCoreScript('jquery');
                            cs()->registerScriptFile(tbu('scripts/jquery.lazyload.js'));
                            if('postView' == $this->id.ucfirst($this->action->id)) {
                                cs()->registerScriptFile(tbu('scripts/jquery.view_page.js'));
                                cs()->registerScriptFile(tbu('scripts/comment-reply.js'));
                                cs()->registerScriptFile(tbu('scripts/jquery.zxxbox.3.0-min.js'));
                            }
                            ?>
                            </body>
                            </html>
